<template>
  <div>
    <div>User name: {{ profile.name }}</div>
    <div>User age: {{ profile.age }}</div>
    <button type="button" @click="close">Close</button>
  </div>
</template>

<script setup>
defineProps({
  params : [{
    name: 'name',
    type: String,
    default: 'John'
  }]
})
// declare `close` event
const emit = defineEmits(['close'])

const profile = reactive({
  name: 'John',
  age: 18
});
// emit `close` event to close Modal dialog
const close = () => emit('close', profile.name)
</script>